﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using System.Collections;


namespace CrystalWars
{
  public class Character
    {
        private Texture2D frontside_avatar, backside_avatar;//used for isometric positioning, front view faces lower left, and back = upper left
        //simply flip horizontally to face the other way.
        private Texture2D conversation_avatar; //displayed during coversation or on the mini menu for showing status
        private String type; //class name
        private Stats base_stats; //the base stats for a level 1 character of this class
        private Char[] stat_growth = new Char[6]; //how fast each stat grows, A-E. A being the fastest, E being the slowest.
        //in order of the indexes: HP, MP, attack, defense, special attack, special defense
        //-----------------------------------------
        //to initialize a new character, you need to give it all of this information
        private CharacterClass characterClass;

        public Character(Texture2D t_frntsdavtr, Texture2D t_bcsdavtr, Texture2D t_conv_avtr, CharacterClass t_character_class)
        {

        }
        public Character(Texture2D t_frntsdavtr, Texture2D t_bcsdavtr, Texture2D t_conv_avtr, String t_type,
            int t_HP, int t_MP, int t_atk, int t_def, int t_s_atk, int t_s_def, int t_spd, int t_agl, int t_mov, int t_jmp,
            char HP, char MP, char atk, char def, char s_atk, char s_def,char speed, char agility)
        {
            type = t_type;
            characterClass = new CharacterClass(type);

            char[] growth = characterClass.StatGrowth;
            int[] startStats = characterClass.BaseStat;

            //base_stats = new Stats(startStats[0],startStats[1],startStats[2],startStats[3],startStats[4],startStats[5],startStats[6],startStats[7],characterClass.BaseSpeed, growth[0], growth[1], growth[2], growth[3],growth[4],growth[5],growth[6],growth[7]);
            base_stats = new Stats(t_HP, t_MP, t_atk, t_def, t_s_atk, t_s_def, t_spd, t_agl, t_mov, t_jmp); //,HP, MP, atk, def, s_atk, s_def, speed, agility);

            stat_growth[0] = HP;
            stat_growth[1] = MP;
            stat_growth[2] = atk;
            stat_growth[3] = def;
            stat_growth[4] = s_atk;
            stat_growth[5] = s_def;
            //----------------------
            frontside_avatar = t_frntsdavtr;
            backside_avatar = t_bcsdavtr;
            conversation_avatar = t_conv_avtr;

        }
        public Stats Base_stats
        {
            get { return base_stats; }
        }
        //-----------------------------------------
        public Texture2D get_frontside_avatar()
        {
            return frontside_avatar;
        }
        public void set_frontside_avatar(Texture2D t_frntsdavtr)
        {
            frontside_avatar = t_frntsdavtr;
        }
        public Texture2D get_backside_avatar()
        {
            return backside_avatar;
        }
        public void set_backside_avatar(Texture2D t_bcsdavtr)
        {
            backside_avatar = t_bcsdavtr;
        }
        public Texture2D get_conversation_avatar()
        {
            return conversation_avatar;
        }
        public void set_conversation_avatar(Texture2D t_conv_avtr)
        {
            conversation_avatar = t_conv_avtr;
        }
        //-----------------------------------------
        public String get_type()
        {
            return type;
        }
        public void set_type(String t_type)
        {
            type = t_type;
        }
        //-----------------------------------------
        public char get_HP_stat_growth()
        {
            return stat_growth[0];
        }
        public void set_HP_stat_growth(char t_stat_growth)
        {
            stat_growth[0] = t_stat_growth;
        }
        public char get_MP_stat_growth()
        {
            return stat_growth[1];
        }
        public void set_MP_stat_growth(char t_stat_growth)
        {
            stat_growth[1] = t_stat_growth;
        }
        public char get_attack_stat_growth()
        {
            return stat_growth[2];
        }
        public void set_attack_stat_growth(char t_stat_growth)
        {
            stat_growth[2] = t_stat_growth;
        }
        public char get_defense_stat_growth()
        {
            return stat_growth[3];
        }
        public void set_defense_stat_growth(char t_stat_growth)
        {
            stat_growth[3] = t_stat_growth;
        }
        public char get_special_attack_stat_growth()
        {
            return stat_growth[4];
        }
        public void set_special_attack_stat_growth(char t_stat_growth)
        {
            stat_growth[4] = t_stat_growth;
        }
        public char get_special_defense_stat_growth()
        {
            return stat_growth[5];
        }
        public void set_special_defense_stat_growth(char t_stat_growth)
        {
            stat_growth[5] = t_stat_growth;
        }
    }
  public class Unit
  {
      private Character character;
      private CharacterClass characterclass;
      private Stats stats;
      private String status;
      private int level, turn_charge, experience_points;
      private Vector2 current_position;  //Currently position 0,0 is located in the top left corner of the map!!!!!!!!
      private String[] equipment = new String[5];  //should be string of equipment items, maybe the last slot could be an item they automatically use
      private List<Vector2> Selected_tiles = new List<Vector2>(); //stores selected tiles

      
      //-----------------------------------------
      public Unit(Character t_character)
      {
          character = t_character;
          stats = t_character.Base_stats; //need a way to make deep copy
          status = "Healthy";
          level = 1;
          turn_charge = 0;
          experience_points = 0;
          current_position.X = 0;
          current_position.Y = 0;
          //Change the equipment type to an array of equipment later.
          equipment[0] = "Nothing";
          equipment[1] = "Nothing";
          equipment[2] = "Nothing";
          equipment[3] = "Nothing";
          equipment[4] = "Nothing";
      }
      public Unit(CharacterClass t_cc)
      {
          characterclass = t_cc;
          stats = t_cc.BaseStat
          status = "Healthy";
          level = 1;
          turn_charge = 0;
          experience_points = 0;
          current_position.X = 0;
          current_position.Y = 0;
          //Change the equipment type to an array of equipment later.
          equipment[0] = "Nothing";
          equipment[1] = "Nothing";
          equipment[2] = "Nothing";
          equipment[3] = "Nothing";
          equipment[4] = "Nothing";
      }
      public Unit(Character t_character,
          int t_HP, int t_MP, int t_atk, int t_def, int t_s_atk, int t_s_def, int t_spd, int t_agl, int t_mov,
          int t_lvl, int t_TrnChrg, int t_XP, Vector2 cur_pos,
          String eqpmnt1, String eqpmnt2, String eqpmnt3, String eqpmnt4, String eqpmnt5)
      {

      }


      public void LevelUp()
      {
          level++;

          if (!(level % 2 == 0))
          {
              stats.LevelUp(true);
          }

      }
      public List<Vector2> selected_tiles
      {
          get { return Selected_tiles; }
          set { Selected_tiles = value; }
      }
      public Stats Stats
      {
          get { return stats; }
      }
      public int get_turn_charge()
      {
          return turn_charge;
      }
      public void set_turn_charge(int tc)
      {
          turn_charge = tc;
      }
      public int get_level()
      {
          return level;
      }
      public Stats get_stats()
      {
          return stats;
      }
      public Vector2 get_position()
      {
          return current_position;
      }
      public void set_position(Vector2 pos)
      {
          current_position = pos;
      }
      public void set_x_position(int x)
      {
          current_position.X = x;
      }
      public void set_y_position(int y)
      {
          current_position.Y = y;
      }
      public Character get_character()
      {
          return character;
      }
      public Texture2D get_frontside_avatar()
      {
          return character.get_frontside_avatar();
      }
      public Texture2D get_backside_avatar()
      {
          return character.get_backside_avatar();
      }
      public Texture2D get_conversation_avatar()
      {
          return character.get_conversation_avatar();
      }
  }

  public class Stats
  {
      private int HP, MP, attack, defense, special_attack, special_defense, speed, agility, movement, jump;
      int[] levelUp = new int[] { 9, 8, 7, 6, 5 };
      char[] growth = new char[8];
      //---------------------------------------------------------------------------------------------
      public Stats()
      {
      }
      public Stats(int t_HP, int t_MP, int t_atk, int t_def, int t_s_atk, int t_s_def, int t_spd, int t_agl, int t_mov, int t_jmp)//, char t_HPG, char t_MPG, char t_AtkG, char t_DefG, char t_SAG, char t_SDG, char t_SpG, char t_AgG)
      {
          HP = t_HP;
          MP = t_MP;
          attack = t_atk;
          defense = t_def;
          special_attack = t_s_atk;
          special_defense = t_s_def;
          speed = t_spd;
          agility = t_agl;
          movement = t_mov;
          jump = t_jmp;

          /*
          growth[0] = t_HPG;
          growth[1] = t_MPG;
          growth[2] = t_AtkG;
          growth[3] = t_DefG;
          growth[4] = t_SAG;
          growth[5] = t_SDG;
          growth[6] = t_SpG;
          growth[7] = t_AgG;
           */
      }
      public void LevelUp(bool odd) //change to use character class!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      {
          int[] stats = new int[8];
          if (odd)
          {
              HP += 9;
              MP += 9;
              attack += 9;
              defense += 9;
              special_attack += 9;
              special_defense += 9;
              speed += 9;
              agility += 9;
          }
          else
          {

              for (int i = 0; i < 8; i++)
              {
                  switch (growth[i])
                  {
                      case 'a':
                          stats[i] = 9;
                          break;
                      case 'b':
                          stats[i] = 8;
                          break;
                      case 'c':
                          stats[i] = 7;
                          break;
                      case 'd':
                          stats[i] = 6;
                          break;
                      case 'e':
                          stats[i] = 5;
                          break;
                  }
              }
              HP += stats[0];
              MP += stats[1];
              attack += stats[2];
              defense += stats[3];
              special_attack += stats[4];
              special_defense += stats[5];
              speed += stats[6];
              agility += stats[7];

          }
      }
      public int get_HP()
      {
          return HP;
      }
      public void set_HP(int t_HP)
      {
          HP = t_HP;
      }
      public int get_MP()
      {
          return MP;
      }
      public void set_MP(int t_MP)
      {
          MP = t_MP;
      }
      public int get_attack()
      {
          return attack;
      }
      public void set_attack(int t_atk)
      {
          attack = t_atk;
      }
      public int get_defense()
      {
          return defense;
      }
      public void set_defense(int t_defense)
      {
          defense = t_defense;
      }
      public int get_special_attack()
      {
          return special_attack;
      }
      public void set_special_attack(int t_special_attack)
      {
          special_attack = t_special_attack;
      }
      public int get_special_defense()
      {
          return special_defense;
      }
      public void set_special_defense(int t_special_defense)
      {
          special_defense = t_special_defense;
      }
      public int get_speed()
      {
          return speed;
      }
      public void set_speed(int t_speed)
      {
          speed = t_speed;
      }
      public int get_agility()
      {
          return agility;
      }
      public void set_agility(int t_agility)
      {
          agility = t_agility;
      }
      public int get_movement()
      {
          return movement;
      }
      public void set_movement(int t_movement)
      {
          movement = t_movement;
      }
      public int get_jump()
      {
          return jump;
      }
      public void set_jump(int t_jump)
      {
          jump = t_jump;
      }
  }
 
    public class CharacterClass
  {
      private Texture2D frontside_avatar, backside_avatar;//used for isometric positioning, front view faces lower left, and back = upper left
      private Texture2D conversation_avatar; //displayed during coversation or on the mini menu for showing status

      string className = "";
      string weapon = ""; //weapon type
      string armor = ""; //armor type
      int baseSpeed = 0; //initialization to 0

        //Hp Mp Atk Def SpeAtk SpeDef Speed Agility
      char[] statGrowth = new char[8];

      //Hp Mp Atk Def SpeAtk SpeDef Speed Agility
      int[] baseStat = new int[8];

      List<Ability> abilityList = new List<Ability>();
      Character character;

      public CharacterClass()
      {
          className = "Medic";
          weapon = "pistol";
          armor = "medium";
          baseSpeed = 5;
          PopulateMedicAbilityList(1);
      }
      void setArrays(char gHp,int Hp, char gMp, int Mp, char gAtk, int Atk, char gDef, int Def, char gSpeAtk, int SpeAtk,char gSpeDef,int speDef, char gSpe, int Spe, char gAgi, int agi)
      {
          statGrowth[0] = gHp;
          statGrowth[1] = gMp;
          statGrowth[2] = gAtk;
          statGrowth[3] = gDef;
          statGrowth[4] = gSpeAtk;
          statGrowth[5] = gSpeDef;
          statGrowth[6] = gSpe;
          statGrowth[7] = gAgi;

          baseStat[0] = Hp;
          baseStat[1] = Mp;
          baseStat[2] = Atk;
          baseStat[3] = Def;
          baseStat[4] = SpeAtk;
          baseStat[5] = speDef;
          baseStat[6] = Spe;
          baseStat[7] = agi;
      }
      public int[] BaseStat
      {
          get { return baseStat; }
      }
      public char[] StatGrowth
      {
          get { return statGrowth; }
      }

      public CharacterClass(string t_className, Texture2D t_f_avatar, Texture2D t_b_avatar, Texture2D t_c_avatar)
      {
          className = t_className.ToLower();
          frontside_avatar = t_f_avatar;
          backside_avatar = t_b_avatar;
          conversation_avatar = t_c_avatar;

          switch (className)
          {
              case "medic":
                  className = "Medic";
                  weapon = "pistol";
                  armor = "medium";
                  baseSpeed = 5;
                  PopulateMedicAbilityList(1);
                  setArrays('d', 40, 'b', 20, 'd', 10, 'c', 15, 'a', 20, 'c', 15, 'c', 10, 'c', 10);
                  /*
                  HP = t_HP;
                  MP = t_MP;
                  attack = t_atk;
                  defense = t_def;
                  special_attack = t_s_atk;
                  special_defense = t_s_def;
                  speed = t_spd;
                  agility = t_agl;
                  movement = t_mov;
                  jump = t_jmp;
                  */

                  break;
              case "soldier":
                  className = "Soldier";
                  weapon = "hammer";
                  armor = "heavy";
                  baseSpeed = 4;
                  PopulateSoldierAbilityList(1);
                  setArrays('a', 80, 'e', 10, 'c', 20, 'b', 20, 'e', 15, 'e', 15, 'c', 10, 'c', 10);

                  break;
              case "engineer":

                  className = "Engineer";
                  weapon = "smg";
                  armor = "heavy";
                  baseSpeed = 4;
                  PopulateEngineerAbilityList(1);
                  setArrays('b', 60, 'c', 15, 'c', 15, 'a', 25, 'b', 15, 'c', 15, 'c', 10, 'c', 10);

                  break;
              case "marksman":
                  className = "Marksman";
                  weapon = "rifle";
                  armor = "medium";
                  baseSpeed = 5;
                  PopulateSharpshooterAbilityList(1);
                  setArrays('c', 50, 'e', 10, 'b', 20, 'c', 15, 'c', 10, 'c', 10, 'c', 10, 'c', 10);

                  break;
              case "ghost":
                  className = "Ghost";
                  weapon = "knifes";
                  armor = "light";
                  baseSpeed = 6;
                  PopulateGhostAbilityList(1);
                  setArrays('d', 35, 'c', 15, 'a', 20, 'c', 10, 'd', 10, 'c', 15, 'b', 10, 'b', 10);

                  break;
              case "harvester":
                  className = "Harvester";
                  weapon = "rod";
                  armor = "light";
                  baseSpeed = 6;
                  PopulateHarvesterAbilityList(1);
                  setArrays('e', 10, 'c', 10, 'd', 10, 'd', 10, 'a', 20, 'a', 20, 'b', 10, 'b', 10);

                  break;
          }
      }

      public void updateList(int level)
      {

          switch (className)
          {
              case "medic":
                  PopulateMedicAbilityList(level);
                  break;
              case "soldier":
                  break;
              case "engineer":
                  PopulateEngineerAbilityList(level);
                  break;
              case "sharpshooter":
                  PopulateSharpshooterAbilityList(level);
                  break;
              case "ghost":
                  PopulateGhostAbilityList(level);
                  break;
              case "harvester":
                  PopulateHarvesterAbilityList(level);
                  break;
          }
      }

      public List<Ability> AbilityList
      {
          get { return abilityList; }
      }
      public string ClassName
      {
          get { return className; }
      }
      public string Weapon
      {
          get { return weapon; }
      }
      public string Armor
      {
          get { return armor; }
      }
      public int BaseSpeed
      {
          get { return baseSpeed; }
      }
      public Stats BaseStat
      {
          //get { return baseStat; }
      }

      void PopulateMedicAbilityList(int level)
      {
          abilityList.Clear(); //clear list

          abilityList.Add(new Ability("Aid", "ally", "single", false, 3, "holy", "none", 0, -100, "speAtk", 10, "Restore some of an allies HP")); //basic healing spell

          if (level > 3)
              abilityList.Add(new Ability("Protection", "ally", "single", false, 3, "holy", "defUp", 100, 0, "speAtk", 10, "Slightly raises allies defense"));
          if (level > 7)
              abilityList.Add(new Ability("Boost", "ally", "single", false, 3, "holy", "atkUp", 100, 0, "speAtk", 10, "Boost the attack on an ally"));
          if (level > 11)
              abilityList.Add(new Ability("Heavy Aid", "ally", "single", false, 3, "holy", "none", 0, -150, "speAtk", 20, "Restore a moderate potion of HP"));
          if (level > 15)
              abilityList.Add(new Ability("Revive", "ally", "single", false, 1, "holy", "none", 0, 0, "speAtk", 50, "Revive a KO'd ally"));
          if (level > 19)
              abilityList.Add(new Ability("Smite", "enemy", "burst", false, 4, "holy", "none", 0, 200, "speAtk", 40, "Large discharge of holy energy sears foes"));
      }
      void PopulateSoldierAbilityList(int level)
      {
          abilityList.Clear(); //clear list

          abilityList.Add(new Ability("Shield", "self", "single", false, 1, "physical", "defUp", 100, 0, "def", 0, "Improved Defend")); //basic healing spell

          if (level > 3)
              abilityList.Add(new Ability("Falcon's edge", "enemy", "single", false, 1, "physical", "none", 0, 180, "speAtk", 5, "Two quick attacks"));
          if (level > 7)
              abilityList.Add(new Ability("Slam", "enemy", "single", false, 1, "physical", "push3", 50, 80, "atk", 5, "Shield slam that sometimes pushes an enemy back"));
          if (level > 11)
              abilityList.Add(new Ability("Stim", "self", "single", false, 1, "physical", "stim", 100, 10, "hp", 0, "At the cost of 10% max hp, raises speed, attack and defense"));
          if (level > 15)
              abilityList.Add(new Ability("Hammerblow", "enemy", "single", false, 1, "physical", "stun", 70, 100, "atk", 10, "Stikes the enemy hard with the blunt end of the weapon, possibly stunning them"));
          if (level > 19)
              abilityList.Add(new Ability("Judgement", "enemy", "burst", false, 2, "physical", "none", 0, 200, "speAtk", 40, "A thunderous blow causes a shockwave, damaging nearby enemies"));
      }
      void PopulateHarvesterAbilityList(int level)
      {
          abilityList.Clear(); //clear list

          abilityList.Add(new Ability("Flame", "enemy", "line", false, 5, "fire", "none", 0, 200, "speAtk", 10, "Hurls a raging fireball at the enemy")); //basic healing spell

          if (level > 3)
              abilityList.Add(new Ability("Frost", "enemy", "line", false, 5, "ice", "none", 0, 200, "speAtk", 10, "A jet of frost shoots from the finger tips to freeze the enemy"));
          if (level > 7)
              abilityList.Add(new Ability("Shock", "enemy", "line", false, 5, "lightning", "none", 0, 200, "speAtk", 10, "A lightning bolt is cast out shocking all those in it's path"));
          if (level > 11)
              abilityList.Add(new Ability("Flood", "enemy", "line", false, 5, "water", "none", 0, 200, "speAtk", 10, "A stream of water drowning those who foolish oppose it"));
          if (level > 15)
              abilityList.Add(new Ability("Explosion", "enemy", "burst", false, 3, "physical", "none", 0, 400, "speAtk", 40, "An explosion causing a significant shockwave damaging nearby eneimes"));
          if (level > 19)
              abilityList.Add(new Ability("Cataclysm", "enemy", "burst", true, 5, "magic", "none", 0, 600, "speAtk", 80, "A large mixture of energies causing a deadly explosion, obliterating all within the blast"));
      }
      void PopulateEngineerAbilityList(int level)
      {
          abilityList.Clear(); //clear list

          abilityList.Add(new Ability("Analysis", "enemy", "single", false, 8, "none", "revealed", 100, 0, "speAtk", 5, "Identifies enemy weaknesses")); //basic healing spell

          if (level > 3)
              abilityList.Add(new Ability("Flashbang", "enemy", "burst2", true, 3, "none", "stun", 60, 0, "speAtk", 10, "Throws a special grenade to stun enemies "));
          if (level > 7)
              abilityList.Add(new Ability("Grenade", "enemy", "burst2", true, 3, "physical", "none", 0, 200, "atk", 10, "Throws a frag grenade to damage enemies"));
          if (level > 11)
              abilityList.Add(new Ability("Sandbags", "ally", "single", false, 1, "none", "none", 0, 0, "speAtk", 10, "Builds sangbag barricade to bolster defense"));
          if (level > 15)
              abilityList.Add(new Ability("Turret", "ally", "single", false, 1, "none", "none", 0, 0, "speAtk", 40, "Places a turret on the tile to attack enemies"));
          if (level > 19)
              abilityList.Add(new Ability("Heavy Support", "ally", "single", false, 1, "none", "none", 0, 0, "speAtk", 80, "Engineer calls in for a battle mech, which he pilots"));
      }
      void PopulateGhostAbilityList(int level)
      {
          abilityList.Clear(); //clear list

          abilityList.Add(new Ability("Cloak", "self", "single", false, 1, "none", "cloak", 100, 0, "atk", 10, "Enables a personal cloak, turning unit invisible"));

          if (level > 3)
              abilityList.Add(new Ability("Backstab", "enemy", "single", true, 3, "none", "none", 0, 300, "atk", 10, "User uncloaks commiting a surprise attack"));
          if (level > 7)
              abilityList.Add(new Ability("Death's blade", "enemy", "single", true, 3, "physical", "none", 90, 200, "atk", 10, "Stabs the enemy with a poisoned blade"));
          if (level > 11)
              abilityList.Add(new Ability("Stone blade", "enemy", "single", false, 1, "physical", "none", 70, 200, "atk", 10, "Stabs the enemy turning them to stone"));
          if (level > 15)
              abilityList.Add(new Ability("Escape", "self", "single", false, 1, "none", "none", 0, 0, "atk", 15, "Instantly moves upto 6 spaces"));
          if (level > 19)
              abilityList.Add(new Ability("Assassinate", "enemy", "single", false, 1, "physical", "death", 10, 400, "atk", 30, "A deadly strike that can cause instant death"));
      }
      void PopulateSharpshooterAbilityList(int level)
      {
          abilityList.Clear(); //clear list

          abilityList.Add(new Ability("Burst fire", "enemy", "single", false, 6, "physical", "none", 150, 0, "atk", 5, "Three round burst doing extra damage"));

          if (level > 3)
              abilityList.Add(new Ability("Rifle Grenade", "enemy", "burst2", true, 5, "none", "none", 0, 300, "atk", 10, "A grenade fired from the rifle"));
          if (level > 7)
              abilityList.Add(new Ability("Underslug shotgun", "enemy", "single", false, 3, "physical", "push3", 70, 200, "atk", 10, "An underslug shotgun firing a deer slug pushing enimes back"));
          if (level > 11)
              abilityList.Add(new Ability("Aimmed shot", "enemy", "single", false, 8, "physical", "none", 0, 200, "atk", 10, "An aimmed shot in single fire mode"));
          if (level > 15)
              abilityList.Add(new Ability("Gillie in the mist", "self", "single", false, 1, "none", "cloak", 0, 0, "atk", 15, "Camo and other items obscure the sharpshooter"));
          if (level > 19)
              abilityList.Add(new Ability("Sniper shot", "enemy", "single", false, 10, "physical", "death", 10, 500, "atk", 30, "A hidden sniper single shot, which can kill instantly"));
      }
  }

  public class Ability
  {
      string abilityName;
      string target;
      int range;
      string patern;
      bool rangeAOE;
      string element;
      string statusEffect;
      int statusChance;
      float damageLevel;
      string linkedStat;
      int abilityCost;
      string description;
      /*
       * Need to add suff for animations
       * 
       * 
       */

      public Ability(string t_name, string t_target, string t_pattern, bool t_rangeAOE, int t_Range, string t_element, string t_statusEffect, int t_statusChance, float t_damageLevel, string t_LinkStat, int t_Cost, string t_descr)
      {
          abilityName = t_name;
          target = t_target;
          patern = t_pattern;
          rangeAOE = t_rangeAOE;
          element = t_element;
          range = t_Range;
          statusEffect = t_statusEffect;
          statusChance = t_statusChance;
          damageLevel = t_damageLevel;
          linkedStat = t_LinkStat;
          abilityCost = t_Cost;
          description = t_descr;

      }
      public int Range
      {
          get { return range; }
      }
      public string Pattern
      {
          get { return patern; }
      }
      public string Ability_Name
      {
          get { return abilityName; }
      }
      public string Target
      {
          get { return target; }
      }
      public bool Ranged_AOE
      {
          get { return rangeAOE; }
      }
      public string Element
      {
          get { return element; }
      }
      public string Status_Effect
      {
          get { return statusEffect; }
      }
      public string Linked_Stat
      {
          get { return linkedStat; }
      }
      public string Description
      {
          get { return description; }
      }
      public int Cost
      {
          get { return abilityCost; }
      }

      //Damaage = primary * (0.01 * damageLevel) + (primary * 0.1 * random 1-5 )
      public int CalcDamage(int primary, bool crit)
      {
          double dblDamage;
          Random rnd = new Random(DateTime.Now.Second);

          dblDamage = (primary * 0.01 * damageLevel) + (primary * 0.01 * rnd.Next(1, 6));

          if (crit)
              dblDamage *= 1.5;

          return (int)Math.Round(dblDamage, 0);
      }
      public bool statusApplied() //roll 100 sided di
      {
          Random rnd = new Random(DateTime.Now.Second);

          int num = rnd.Next(1, 100);

          if (num < statusChance)
              return true;

          return false;
      }
  }
}
